import request from '../utils/request.js';
import request1 from '../utils/request1.js';
//通用添加
export function generalSave(data){
	return request({
		url:'/clientOperation/generalSaveForClient',
		method:'POST',
		data,
	})
}

//通用表名查询
export function generalQueryByTableName(data){
	return request({
		url:'/salesOrder/queryShoppingTrolleyByTableName',
		method:'GET',
		data,
	})
}
//通用SQL查询
export function generalQueryBySQLSerialNumber(data){
	return request({
		url:'/salesOrder/queryShoppingTrolleyBySQLSerialNumber',
		method:'POST',
		data,
	})
}
//通用查询，带子表查询
export function getSubtableInquiry(data){
	return request1({
		url:'/getSubtableInquiry?grant_type=tourist',
		method:'POST',
		data,
	})
}
//通用分页查询
export function generalPaginationQueryBySQLSerialNumber(data){
	return request({
		url:'/salesOrder/getUserAddressForPagination',
		method:'GET',
		data,
	})
}
//获取用户Open_ID
export function generalWeChatOpenID(data){
	return request1({
		url:'/getWeChatOpenIDAction',
		method:'POST',
		data,
	})
}
//获取用户Open_ID
export function getOpenIdByCode({Code}){
	return request({
		url:`/wechatMiniprogram/getOpenIdByCode?Code=${Code}`,
		method:'GET',
	})
}
//通过表名查询多张表
export function getMemberPoint(data){
	return request({
		url:'/member/getMemberPoint',
		method:'POST',
		data,
	})
}
//发送验证码
export function SendSms({phone,code}){
	return request({
		url:`/login/SendSms?Telephone=${phone}&Code=${code}`,
		method:'GET'
	})
}
//取redis中变量
export function getRedis({Key}){
	return request1({
		url:`/GetRedis?Key=${Key}`,
		method:'GET'
	})
}
//取redis中变量
export function generalSaveFilesAsImage(data){
	return request({
		ContentType:'application/json;charset=UTF-8',
		url:`/clientOperation/generalSaveFilesAsImage`,
		method:'POST',
		data
	})
}
